package cn.ryh.servlet.code.config;

import cn.ryh.servlet.code.CodeServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Rao
 * @Description
 * @create 2022-04-15 17:12
 */
@Configuration
public class CodeConfig {
    /**
     * 注册Servlet.
     *
     * @return
     */
    @Bean
    public ServletRegistrationBean<CodeServlet> codeServlet() {
        //第二个参数为urlPartern
        return new ServletRegistrationBean<>(new CodeServlet(), "/codeServlet");
    }
}
